//
//  TableViewCell.m
//  App架构Simple
//
//  Created by 胡锦涛 on 2019/2/16.
//  Copyright © 2019 胡锦涛. All rights reserved.
//

#import "TableViewCell.h"
#import "User.h"
@implementation TableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
    
        self.nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 0, self.frame.size.width-20, self.frame.size.height)];
        self.nameLabel.font = [UIFont systemFontOfSize:20];
        self.nameLabel.backgroundColor = kRANDOM_COLOR;
        [self.contentView addSubview:self.nameLabel];
    }
    return self;
}

-(void)setModel:(User *)model {
    _model = model;
    self.nameLabel.text = model.name;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end
